home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / utility / wfind.zip / WF2.BAT next >
DOS Batch File  |  1996-06-19  |  3KB  |  135 lines

  1. @echo off
  2. REM  the following two lines give white on blue if ANSI.SYS is loaded
  3. REM  you should get white on blue even if ANSI.SYS is not loaded.
  4. echo 
  5. echo 
  6. cls
  7. rem ---------------------------------------------------------
  8. echo.
  9. echo NOTICE:
  10. echo This program creates and overwrites the following files:
  11. echo.
  12. echo      the File List         filelist.lst
  13. echo      the Search List       srchlist.lst
  14. echo      the Batch File        xwnewbat.bat
  15. echo.
  16. if "%TEMP%" == "" goto cc
  17. echo on the %TEMP% subdirectory.
  18. goto dd
  19. :cc
  20. echo on the current root directory on the current drive.
  21. :dd
  22. echo.
  23. echo If this is OK press the Y key, otherwise press the N key.
  24. echo.
  25. wfind2 /c /c:yn
  26. if errorlevel 2 goto quit
  27. rem  -----------------------------------------------------
  28.  
  29. shift
  30.  
  31. :restart
  32.  
  33. if "%0" == "" goto msg
  34. wfind2 /c /F %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  35. if errorlevel 1 goto msg
  36.  
  37. :start
  38. echo.
  39. echo.                      
  40. echo                         WFIND2 - DOS Search Program
  41. echo.
  42. echo    1. Search
  43. echo    2. NOT Search
  44. echo    3. AND Search
  45. echo    4. AND NOT Search
  46. echo    5. OR Search
  47. echo    6. OR NOT Search
  48. echo    X  Extract Display / Act
  49. echo    R  Restart the File List
  50. echo    H  Help
  51. echo    Q  Quit
  52. echo.
  53.  
  54. wfind2 /c /c:123456XRHQ
  55.  
  56. if errorlevel 10 goto quit
  57. if errorlevel 9 goto help
  58. if errorlevel 8 goto restart
  59. if errorlevel 7 goto xdisp
  60. if errorlevel 6 goto onsrch
  61. if errorlevel 5 goto osrch
  62. if errorlevel 4 goto ansrch
  63. if errorlevel 3 goto asrch
  64. if errorlevel 2 goto nsrch
  65. if errorlevel 1 goto srch
  66. goto quit
  67.  
  68. :srch
  69. wfind2 /c
  70. goto start
  71.  
  72. :nsrch 
  73. wfind2 /c /n
  74. goto start
  75.  
  76. :asrch
  77. wfind2 /c /a
  78. goto start
  79.  
  80. :ansrch
  81. wfind2 /c /a /n
  82. goto start
  83.  
  84. :osrch
  85. wfind2 /c /o
  86. goto start
  87.  
  88. :onsrch
  89. wfind2 /c /o /n
  90. goto start
  91.  
  92. :xdisp
  93. wfind2 /c /x
  94. if not errorlevel 128 goto start
  95. if exist %TEMP%\xwnewbat.bat goto aa
  96. if exist %TEMP%xwnewbat.bat goto bb
  97. echo the Batch File is not found
  98. pause
  99. goto start
  100.  
  101. :aa 
  102. call %TEMP%\xwnewbat.bat
  103. wfind2 /z
  104. goto start
  105. :bb
  106. call %TEMP%xwnewbat.bat
  107. wfind2 /z
  108. goto start
  109.  
  110. :msg
  111. cls
  112. echo To begin:
  113. echo Enter WF2 followed by filenames (up to 10 items, wild cards * and ? are 
  114. echo ok) echo on the command line, separated by spaces. To search all 
  115. echo subdirectories echo for an item, follow the item by /S (no space).
  116. echo. 
  117. echo Enter WF2 *.* to create a File List of all files on the current directory 
  118. echo for the current drive. Enter WF2 C:\*.TXT/S to create a File List of all 
  119. echo files on drive C with extension TXT.
  120. echo.
  121. echo To access the help file directly, enter: wfind2 /H wfind2.DOC
  122. echo.
  123. echo.
  124. goto end
  125.  
  126. :help
  127. wfind2 /c /h wfind2.doc
  128. goto start
  129.  
  130. :quit
  131. REM  the following line gives white on black if ANSI.SYS is loaded.
  132. echo 
  133. cls
  134. :end
  135.